﻿import { defineStore } from 'pinia'

export const useSearchStore = defineStore('search', {
  state: () => ({
    openModal: false as boolean,

  }),
  actions: {
    setOpenModal(status: boolean) {
      this.openModal = status
      if (status) {
        document.body.classList.add('modal--active')
      } else {
        document.body.classList.remove('modal--active')
        document.getElementById('App-Container')?.focus()
      }
    },
  },
});
